package com.cn.qgx428.lazydiary.ui.timeline

import android.content.Context
import android.view.View
import android.widget.TextView
import com.cn.qgx428.lazydiary.R
import com.cn.qgx428.lazydiary.extension.getCurrenDayOfYear
import java.util.*

/**
 * Created by qinguanxiong on 2018/4/5.
 */
class T_TOP(context: Context, mView: View?) : T_Base(context, mView) {

    lateinit var day_txt: TextView

    override fun initView() {
        day_txt = getView(R.id.timeline_top_day)
    }

    override fun initEvent() {
    }

    override fun getData() {
        val time = Calendar.getInstance().getCurrenDayOfYear()
        val dayStart = time.indexOf("月") + 1
        val dayEnd = time.indexOf("日") - 1
        val day = time.substring(dayStart..dayEnd)
        day_txt.text = day
    }

    override fun onDataChange() {
    }
}